<template>
	<view class="content">
		<view v-for="(item,index) in list" :key="index">
			<view class="item">
				<view class="code">
					<text>结算单据编号 {{item.sn_code}}</text>
				</view>
				<view class="list">
					<text class="name">结算金额</text>
					<text >{{(item.settlement_amount*1).toFixed(2)}}</text>
				</view>
				<view class="list">
					<text class="name">结算单价</text>
					<text >{{(item.purchase_inbound.goods_price*1).toFixed(2)}}</text>
				</view>
				<view class="list">
					<text class="name">数量</text>
					<text>{{(item.purchase_inbound.goods_real_num*1).toFixed(4)}}</text>
				</view>
				<view class="list">
					<text class="name">单据日期</text>
					<text >{{item.purchase_inbound.signer_date}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import {
		ref,
		reactive
	} from 'vue';
	import {onLoad} from '@dcloudio/uni-app';
	import {getSettlement} from '../../../network/main.js';
	onLoad((res)=>{
		getList(res.id)
	})
	const getList = (id)=>{
		let data= {
			payment_id:id
		}
		getSettlement(data).then(res=>{
			Object.assign(list,res.data.data)
		})
	}
	const list = reactive([])
</script>

<style lang="scss">
	.item {
		margin: 20rpx 0;
		background-color: #fff;
		padding: 20rpx 30rpx 20rpx 80rpx;
		box-sizing: border-box;
		position: relative;	
	
		.code {
			font-size: 32rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			color: #333;
	
			.status {
				font-size: 28rpx;
			}
		}
	
		.list {
			width: 100%;
			margin-top: 20rpx;
			font-size: 28rpx;
			color: #333;
	
			.name {
				display: inline-block;
				width: 180rpx;
				text-align: right;
				margin-right: 30rpx;
			}
		}
	}

</style>